let touchStatus = false;   //滑动放触
Component({
    data: {
        startX: 0,
        activeIndex: 0,  //显示活跃下标
    },
    props: {
        baseUrl:'',
        couponData: [],
        onMoveSwiper:null ,
        initActiveIndex:0
    },
    didUpdate () { },
    async didMount () {
        this.initData()
        $global.mfutil.emitter.on('moveTimeSwiper',(params)=>{
          this.moveLine(params)
          // console.log('moveCouponSwiper',nextactiveIndex)
        })
    },
    methods: {
        initData () {
            this.setData({
                activeIndex:this.props.initActiveIndex
            })
        },
        clickTime(event){
          const {index} = event.target.dataset;
          this.props.onMoveSwiper({nextactiveIndex:+index})
        },
        moveLine ({nextactiveIndex=0}) {
            this.setData({
                activeIndex:nextactiveIndex
            })

        }
    }
})
